package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 公司员工表
 * </p>
 *
 * @author ligang
 * @since 2022-03-21
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("com_employee")
@ApiModel(value = "Employee", description = "公司员工表")
@AllArgsConstructor
public class Employee extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID")
    @TableField(value = "company_id")
    @Excel(name = "公司ID")
    private Long companyId;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @TableField(value = "user_account_id")
    @Excel(name = "用户ID")
    private Long userAccountId;

    /**
     * 是否为管理员 1是 0否
     */
    @ApiModelProperty(value = "是否为管理员 1是 0否")
    @TableField(value = "is_admin")
    @Excel(name = "是否为管理员 1是 0否")
    private Integer isAdmin;

    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enabled")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnabled;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDeleted;

    /**
     * 职务
     */
    @ApiModelProperty(value = "职务")
    @Size(max = 255, message = "职务长度不能超过255")
    @TableField(value = "duty", condition = LIKE)
    @Excel(name = "职务")
    private String duty;

    /**
     * 部门
     */
    @ApiModelProperty(value = "部门")
    @Size(max = 255, message = "部门长度不能超过255")
    @TableField(value = "department", condition = LIKE)
    @Excel(name = "部门")
    private String department;

    /**
     * 英文职务
     */
    @ApiModelProperty(value = "英文职务")
    @Size(max = 255, message = "英文职务长度不能超过255")
    @TableField(value = "en_duty", condition = LIKE)
    @Excel(name = "英文职务")
    private String enDuty;

    /**
     * 名片url
     */
    @ApiModelProperty(value = "名片url")
    @Size(max = 255, message = "名片url长度不能超过255")
    @TableField(value = "business_card_url", condition = LIKE)
    @Excel(name = "名片url")
    private String businessCardUrl;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    @Size(max = 255, message = "姓名长度不能超过255")
    @TableField(value = "nick_name", condition = LIKE)
    @Excel(name = "姓名")
    private String nickName;

    /**
     * 英文姓名
     */
    @ApiModelProperty(value = "英文姓名")
    @Size(max = 255, message = "英文姓名长度不能超过255")
    @TableField(value = "en_nick_name", condition = LIKE)
    @Excel(name = "英文姓名")
    private String enNickName;


    @Builder
    public Employee(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long companyId, Long userAccountId, Integer isAdmin, Long projectId, Integer isEnabled, 
                    Integer isDeleted, String duty, String department, String enDuty, String businessCardUrl, String nickName, String enNickName) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.companyId = companyId;
        this.userAccountId = userAccountId;
        this.isAdmin = isAdmin;
        this.projectId = projectId;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.duty = duty;
        this.department = department;
        this.enDuty = enDuty;
        this.businessCardUrl = businessCardUrl;
        this.nickName = nickName;
        this.enNickName = enNickName;
    }

}
